-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Begin porting the web POC to react native #10
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Web works great and the code is very clean! I left some comments from my testing on iOS. I am totally happy leaving the harder ones as TODO
s in the code if we mark them as such and looking at them later.
src/style/StyleSheet.js
Outdated
padding: 8, | ||
}, | ||
mainContentWrapper: { | ||
height: 'calc(100vh - 73px)', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mobile does not like this line, it chokes on it. Is there anyway to refactor it to not use calc
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah phooey. I can keep trying, yeah.
src/Expensify.js
Outdated
<Route path="/" component={HomePage} /> | ||
</Switch> | ||
</Router> | ||
<Beforeunload onBeforeunload={ActiveClientManager.removeClient}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mobile doesn't play well with this, it seems to use window
quite a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dang, this was supposed to be compatible :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not an expert on this event, but could we use AppState
instead? It is supported by RN and RN4W out of the box: https://github.com/necolas/react-native-web#modules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tested this and yes it does change to inactive
when the tab is changed, then back to active
when it comes back. This sounds like possibly we need to handle it using a native/web solution (like Router
).
const myPersonalDetails = allPersonaDetails[currentLogin]; | ||
return Store.multiSet({ | ||
[STOREKEYS.PERSONAL_DETAILS]: allPersonaDetails, | ||
[STOREKEYS.MY_PERSONAL_DETAILS]: myPersonalDetails, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if you see this on web but iOS complains whenever something is set that is undefined
(as this is on boot), not sure if or when we want to set a default value, but it could keep the logs from being too noisy if we added one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think I've seen those errors, no. What is undefined
when that happens. Is it myPersonalDetails
or allPersonaDetails
(which I just realized has a typo)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was myPersonalDetails
that was undefined
Co-authored-by: Andrew Gable <andrewgable@gmail.com>
Co-authored-by: Andrew Gable <andrewgable@gmail.com>
…eactNativeChat into tgolen-port-webpoc
src/page/HomePage/SidebarLink.js
Outdated
<Text style={textActiveStyle}>{this.props.reportName}</Text> | ||
{this.state.isUnread && ( | ||
<Text style={textActiveStyle}>- Unread</Text> | ||
)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not exactly clear why, but this needs to be wrapped in a view for iOS to work.
<Text style={textActiveStyle}>{this.props.reportName}</Text> | |
{this.state.isUnread && ( | |
<Text style={textActiveStyle}>- Unread</Text> | |
)} | |
<View> | |
<Text style={textActiveStyle}>{this.props.reportName}</Text> | |
{this.state.isUnread && ( | |
<Text style={textActiveStyle}>- Unread</Text> | |
)} | |
</View> |
src/style/StyleSheet.js
Outdated
}, | ||
sidebarLinkActive: { | ||
backgroundColor: '#007bff', | ||
borderRadius: '.25rem', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iOS chokes on rem
values too 😢
It's worth a shot. I'm curious if that will fire on web when the tab
gains/loses focus... which might not really be what we want.
…On Sun, Aug 9, 2020 at 5:13 PM Andrew Gable ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/Expensify.js
<#10 (comment)>
:
> }
render() {
return (
- <Router>
- {/* If there is ever a property for redirecting, we do the redirect here */}
- {this.state.redirectTo && <Redirect to={this.state.redirectTo} />}
-
- <Switch>
- <Route path="/signin" component={SignInPage} />
- <Route path="/" component={HomePage} />
- </Switch>
- </Router>
+ <Beforeunload onBeforeunload={ActiveClientManager.removeClient}>
I am not an expert on this event, but could we use AppState instead? It
is supported by RN and RN4W out of the box:
https://github.com/necolas/react-native-web#modules
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJMAB6W752QPOZVGDS5W4DR74UR7ANCNFSM4PY7Y6VQ>
.
|
🚀 [Deployed](https://github.com/Expensify/Expensify.cash
|
🚀 Deployed to staging by https://github.com/AndrewGable in version: 1.3.77-0 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.3.77-7 🚀
|
* fix: ubo list hover, incorp state hover * feat: improved return type for getFieldRequiredErrors
…-settings Improve workspace settings on Main Pane
Deploying helpdot with Cloudflare Pages
|
…tion-report-view Revert "Add One Transaction Report View"
Lots of stuff in this!